<script>
	export default {
		onLaunch: function(e) {
			// this.watchPermission()
			// this.$store.commit('user/getImg')
			if (this.$store.state.login.token) {
				uni.reLaunch({
					url: '/pages/index/index'
				})
			} else {
				uni.reLaunch({
					url: '/pages/login/login'
				})
			}
		},
		onShow: function() {

		},
		onHide: function() {

		},
		methods: {
			watchPermission() {
				//#ifdef APP-PLUS
				this.permissionListener = uni.createRequestPermissionListener();
				this.permissionListener.onConfirm((e) => {
					this.$store.commit('permissions/setPermissionAlertShowFalse', {
						isPermissionAlertShow: true,
						permissionType: e[0]
					})
				});
				this.permissionListener.onComplete((e) => {
					this.$store.commit('permissions/setPermissionAlertShowFalse', {
						isPermissionAlertShow: false,
						permissionType: ''
					})
				});
				//#endif
			},
		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "@/uni_modules/uview-ui/index.scss";
	@import '@/static/iconfont/iconfont.css';
	.u-loading-page{
		display: flex;
		flex-direction: column;
		height: 75vh;
		justify-content: center;
	}
	.empty-box{
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: 70vh;
	}
</style>